-----------
motif prior
-----------

MotifPriorGencode_p5.txt
See how Kimbie generated this prior at:
/udd/rekrg/People/Camila
Uses transcript annotation from Gencode v39 and CISBP Build 2.00 
Scan for motifs -750,+250 bp around the transcription start site
motif hits (p<1e-5) that fall within these promoter regions
997 TFs and 61485 ensembl genes

MotifPriorGencode_p5_HGNC.txt
convert_ens_hgnc_prior.R
Read in the motif prior made on ENS ids, and convert ENS to HGNC using Gencode v39.
ENS ids without HGNC were removed (20666 ENS ids do have a correspondent HGNC)
Since one HGNC can map to multiple ENS ids, I removed the duplicated HGNC rows from the prior.
997 TFs and 39618 gene symbols (HGNC)


----------
female-specific prior
Remove prior edges both coming from Y TFs and going to Y target genes (same as changing the TF-gene motif from one to zero for Y chr edges)
----------
MotifPriorGencode_p5_female.txt
This female prior is wrong because it considers PAR genes as genes in the Y chr and changes their edges to zero.
make_prior_sexSpecific.R 
output file: MotifPriorGencode_p5_female.txt
6 TFs on the Y chr
568 target genes on the Y chr
replaced 52266 Y edges to zeros (both coming from Y TFs and going to Y target genes)


make_prior_sexSpecific_PARonX.R
This code corrects the above and considers PAR genes as genes in the X chr and makes no changes to their prior edges

output file 1: MotifPriorGencode_p5_female_PARonX.txt
4 TFs on the Y chr ("HSFY1"   "HSFY2"   "SRY"     "TGIF2LY")
522 target genes on the Y chr (no PAR genes included)
replaced 44799 Y edges to zeros (both coming from Y TFs and going to Y target genes)

output file 2: MotifPriorGencode_p5_HGNC_female_PARonX.txt
4 TFs on the Y chr ("HSFY1"   "HSFY2"   "SRY"     "TGIF2LY")
430 HGNC target genes on the Y chr (no PAR genes included)
replaced 37003 Y edges to zeros (both coming from Y TFs and going to Y target genes)

_____


__________
PPI prior
----------
make_ppi.R
Uses the STRINGdb Bioconductor package to download PPI from StringDB

ppi_Gencode_p5.txt
STRING.version = "11.5"
Keep all interactions between TFs in the MotifPriorGencode_p5.txt (score.threshold.index=0) and add self-interaction equal to one.
PPI interaction scores were divided by 1000 (to keep TF motif and ppi in the same range (0-1))
PPI is undirected,so made it symetric by adding rows swapping the TF pairs.
Total of 997 TFs

Notes: 992 out of 997 TFs were mapped to StringIDs. ZNF23 was mapped to two StringIDs.
Interactions between 977 TFs. Added self interactions of 1 to each of the 997 TFs.
14% density

4 TFs on the Y chr ("HSFY1"   "HSFY2"   "SRY"     "TGIF2LY"). 
These TFs have no interactions, and only self-interaction set to one. So, self-interaction should remain 1 and no ppi-female-specific prior needed.
(see make_ppi_sexSpecific.R)
